<admintpl file="header" />
</head>
<body>
	<div><br><br>
		<form class="form-horizontal js-ajax-form" action="{:url('Admin/Goods/add_area')}"  >
			<fieldset>
                 <notempty name="result">
                 	<foreach name="result" item="vo">
                    <div class="control-group">
                        <label class="control-label">{$vo.area}价格</label>
                        <div class="controls">
                        	<input type="hidden" name="area_price_id[]" value="{$vo.area_price_id}">
                        	<input type="hidden" name="ability_id[]" value="{$vo.ability_id}">
                            <input type="hidden" name="area_id[]" value="{$vo.id}">
                            <input type="text" name="area_price[]" value="{$vo.area_price}">
                            <span class="form-required">*</span>
                        </div>
                    </div>
                 </foreach>
                 <div class="form-actions">
            		<div class="btn btn-primary" id="save_areabtn">保存</div>
                     <a class="btn" id="js-dialog-close">关闭</a>
				 </div>
                 </notempty>
                 <empty name="result">
                 <foreach name="area" item="vo">
                    <div class="control-group">
                        <label class="control-label">{$vo.area}价格</label>
                        <div class="controls">
                            <input type="hidden" name="area_id" value="{$vo.id}">
                            <input type="text" name="area_price" value="">
                            <span class="form-required">*</span>
                        </div>
                    </div>
                 </foreach>
                 <div class="form-actions">
                    <div class="btn btn-primary" id="check-btn">保存</div>
                    <a class="btn" id="js-dialog-close">关闭</a>
				 </div>
                 </empty>
			</fieldset>
			
		</form>
	</div>
	<script type="text/javascript" src="__STATIC__/js/admin.js?v={:time()}"></script>
    
	<script type="text/javascript">
	 // 提交订单
	$("#check-btn").click(function(){
		var key="{$num}";
		var a=$("form").serialize();
		sessionStorage.setItem(key,JSON.parse(JSON.stringify(a)));
		$('#js-dialog-close').click();
	});
	$("#save_areabtn").click(function(){
		$.post($("form").attr("action"), $("form").serialize(), function(result){
				$('#js-dialog-close').click();
			})
		})
    </script>
</body>
</html>